package org.example.Server.mapper.examination;

import org.apache.ibatis.annotations.Mapper;
import org.example.Server.model.examination.ExamShow;
import org.example.Server.model.examination.ExamStuQna;
import org.example.Server.model.examination.ExamStuSel;
import org.example.Server.model.examination.ExamSubmitDTO;
import org.example.Server.model.examination.qs.QSSubmitDTO;
import org.example.Server.model.examination.qs.QsAnsMax;

import java.util.List;

/**
 * 在线考试教师和学生端公共
 */
@Mapper
public interface ExamMapper {
    List<ExamShow> getExamList(Integer semId, Integer status);

    List<ExamShow> getExamStuList(Integer semId, Integer status, Integer userId);

    List<ExamStuQna> getStuQandA(Integer paperId, Integer stuExamId, Integer stuId);

    List<ExamStuSel> getStuQSelect(Integer paperId, String qsType, Integer stuExamId, Integer stuId);

    QsAnsMax getSelQsAnsMax(ExamSubmitDTO examSubmitDTO, Integer qsId);

    void addStuExamSubmit(ExamSubmitDTO examSubmitDTO);

    void addStuExamQsSubmit(Integer stuExamId, List<QSSubmitDTO> qsStuExams);

    void addStuExamSelSubmit(List<QSSubmitDTO> questions);

    void addStuExamQnaSubmit(List<QSSubmitDTO> qnaList);

    Integer getExamStuExist(ExamSubmitDTO examSubmitDTO);

    QsAnsMax getQnaQsAnsMax(ExamSubmitDTO examSubmitDTO, Integer qsId);
}
